/**
 * 
 */
package com.probiz.estore.common.model.content.base;

import java.io.Serializable;

import com.probiz.estore.common.model.content.Newsletter;
import com.probiz.estore.common.model.content.NewsletterGroup;

/**
 * @author pengzhirong
 *
 */
/**
 * @author Ryan
 *
 */
public class NewsletterGroupNewsletterPK implements Serializable{
	
	private static final long	serialVersionUID	= 1232311L;

	protected Newsletter newsletter;
	
	protected NewsletterGroup newsletterGroup;
	
	public NewsletterGroupNewsletterPK(){
		
	}
	
	public NewsletterGroupNewsletterPK(Newsletter newsletter, NewsletterGroup newsletterGroup){
		this.newsletter = newsletter;
		this.newsletterGroup = newsletterGroup;
	}

	public Newsletter getNewsletter() {
		return newsletter;
	}

	public void setNewsletter(Newsletter newsletter) {
		this.newsletter = newsletter;
	}

	public NewsletterGroup getNewsletterGroup() {
		return newsletterGroup;
	}

	public void setNewsletterGroup(NewsletterGroup newsletterGroup) {
		this.newsletterGroup = newsletterGroup;
	}

    @Override
    public int hashCode()
    {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((newsletter == null) ? 0 : newsletter.hashCode());
        result = prime * result + ((newsletterGroup == null) ? 0 : newsletterGroup.hashCode());
        return result;
    }

    @Override
    public boolean equals(Object obj)
    {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        final NewsletterGroupNewsletterPK other = (NewsletterGroupNewsletterPK) obj;
        if (newsletter == null)
        {
            if (other.newsletter != null)
                return false;
        }
        else if (!newsletter.equals(other.newsletter))
            return false;
        if (newsletterGroup == null)
        {
            if (other.newsletterGroup != null)
                return false;
        }
        else if (!newsletterGroup.equals(other.newsletterGroup))
            return false;
        return true;
    }
	
	

}
